<%


'option explicit
dim BodyText, IP, refURL
dim lsBadLink, mail, email
Dim objErrorInfo,ASPCode,ASPDescription,Category,tempColumn,tempDescription,tempFile,tempLine,tempNumber,tempSource, cdoMessage, supportMail
Set objErrorInfo = Server.GetLastError 

ASPCode = objErrorInfo.ASPCode
ASPDescription = objErrorInfo.ASPDescription
Category = objErrorInfo.Category
tempColumn = objErrorInfo.Column
tempDescription = objErrorInfo.Description
tempFile = objErrorInfo.File
tempLine = objErrorInfo.Line
tempNumber = objErrorInfo.Number
tempSource =  objErrorInfo.Source
tempSite = "www.feifinancial.com"
shorturl = replace(tempSite,"www.","")

'response.buffer = false
'response.write "here"
IP = request.servervariables("REMOTE_HOST")
refURL = request.servervariables("HTTP_REFERER")

'response.write IP & refURL
	lsBadLink = request.servervariables("QUERY_STRING")


	BodyText = BodyText & "IP Address = " & IP & chr(13) & chr(10) & "<br>"
	BodyText = BodyText & "refURL = " & refURL & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "ASPCode = " & ASPCode & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "ASPDescription = " & ASPDescription & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Category = " & Category & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Column = " & tempColumn & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Description = " & tempDescription & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "File = " & tempFile & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Line = " & tempLine & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Number = " & tempNumber & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Source = " & tempSource & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "Site = " & tempSite & chr(13)  & chr(10) & "<br>"
	BodyText = BodyText & "QueryString = " & lsBadLink & chr(13)  & chr(10) & "<br>"

supportMail = "chrisburres@e-webstyle.com"
		
					Set cdoMessage = Server.CreateObject("CDO.Message")
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
'Send the message using the network (SMTP over the network). 
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.gmail.com" 
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 ' or 587 
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60  
' Google apps mail servers require outgoing authentication. Use a valid email address and password registered with Google Apps. 
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication 
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="warehouse@feifinancial.com" 'your Google apps mailbox address 
cdoMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="WareHouse245" 'Google apps password for that mailbox 

cdoMessage.Configuration.Fields.Update 

 
					
						cdoMessage.From =  "support@" & shorturl & "(" & shorturl & ")"
						cdoMessage.To = supportMail
'						cdoMessage.Bcc = "chrisburres@e-webstyle.com"
						cdoMessage.Subject = "404 Error - " & shorturl
						cdoMessage.htmlBody = BodyText 				
						cdoMessage.Send
					
					
%>


  <div id="content_wrapper">
    
    	<div class="main_content">
      
            
      <table width="780" border="0" align="center" cellpadding="5" cellspacing="0">
      <tr><td><!--#include file="topAll.asp"-->
</td></tr>
            <tr> 
              <td bgcolor="#FFFFFF" colspan="2"> 
                <p align="center">
				<font size="6" face="Arial, Helvetica, sans-serif" color="#3366FF">
				404 File Not Found</font></p>
                <p align="center">
				<font size="6" face="Arial, Helvetica, sans-serif" color="#3366FF">
				The page you are looking for does not currently exit. This error 
				has been reported to the webmaster. Please forgive the 
				inconvenience. Click</font><font size="6" face="Arial, Helvetica, sans-serif" color="#FF0000">
				<a href="http://<%=tempSite %>/"><u>
				Here</u></a> 
                  </font>
                  <% 'response.write BodyText %>
				<font size="6" face="Arial, Helvetica, sans-serif" color="#3366FF">
				to go back to our home page.</font></p>
                <p align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#6600FF">
				Your IP <%=ip%> has been recorded.</font></p>              </td>
            </tr>
            <tr><td> <!--#include file="downAll.asp"--></td></tr>
      </table>
       <% 'DisplayCollection(request.servervariables) %>
    </div><!--  main_content   --> 
    	
 </div><!--  content_wrapper  -->

